﻿using BCCommon;
using BCDto.Common.TreeNode;
using BCDto.Sim.Admin.Admin;
using BCDto.Sim.Admin.TreePermission;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace BCService.Sim.Admin.TreePermission
{
    /// <summary>
    /// 新版无限级树形权限
    /// </summary>
    public interface ITreePermissionConfigService
    {
        /// <summary>
        /// 添加新版无限级树形权限
        /// </summary>
        /// <param name="requestDto">权限</param>
        /// <returns></returns>
        TreePermissionConfigDto Add(TreePermissionConfigRequestDto requestDto);

        /// <summary>
        /// 修改新版无限级树形权限
        /// </summary>
        /// <param name="treePermissionConfigId">权限Id</param>
        /// <param name="requestDto">权限</param>
        /// <returns></returns>
        TreePermissionConfigDto Update(long treePermissionConfigId, TreePermissionConfigRequestDto requestDto);
        /// <summary>
        /// 更新树形权限是否显示
        /// </summary>
        /// <param name="treePermissionConfigId">树形权限配置Id</param>
        /// <param name="isShow">是否显示</param>
        void UpdateShow(long treePermissionConfigId, bool isShow);
        /// <summary>
        /// 删除新版无限级树形权限
        /// </summary>
        /// <param name="treePermissionConfigId">权限Id</param>
        void Delete(long treePermissionConfigId);

        /// <summary>
        /// 获取新版无限级树形权限
        /// </summary>
        /// <param name="permissionName">权限名称</param>
        /// <param name="permissionCode">权限码</param>
        /// <param name="permissionPathCode">权限路径码</param>
        /// <param name="parentPermissionPathCode">父级权限路径码</param>
        /// <param name="ascending">升序</param>
        /// <param name="pageIndex">当前页码</param>
        /// <param name="pageSize">页面数据条数</param>
        /// <returns></returns>
        PageableList<TreePermissionConfigDto> Query(string permissionName, string permissionCode, string permissionPathCode, string parentPermissionPathCode, bool? ascending, int pageIndex, int pageSize);

        /// <summary>
        /// 获取新版无限级树形权限列表
        /// </summary>
        /// <param name="permissionName">权限名称</param>
        /// <param name="permissionCode">权限码</param>
        /// <param name="permissionPathCode">权限路径码</param>
        /// <param name="parentPermissionPathCode">父级权限路径码</param>
        /// <returns></returns>
        IEnumerable<TreePermissionConfigDto> GetList(string permissionName, string permissionCode, string permissionPathCode, string parentPermissionPathCode);
        /// <summary>
        /// 获取树形新版权限级树形权限列表
        /// </summary>
        /// <returns></returns>
        List<TreeNodeDto<TreePermissionConfigDto>> GetTreePermission();

    }
}
